package com.wish.wishhouse_resource.controller;



import com.wish.wishhouse_resource.entity.TbBusiness;
import com.wish.wishhouse_resource.entity.TbPremisesInfo;
import com.wish.wishhouse_resource.entity.TbPublicFacility;
import com.wish.wishhouse_resource.service.ITbBusinessService;
import com.wish.wishhouse_resource.service.ITbPremisesInfoService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import vo.ResultEntity;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 楼盘信息表 前端控制器
 * </p>
 *
 * @author zhangshuxin
 * @since 2021-03-28
 */
@RestController
@RequestMapping("/tbPremisesInfo")
public class TbPremisesInfoController {


    @Resource
    private ITbPremisesInfoService tbPremisesInfoService;
    @Resource
    private ITbBusinessService tbBusinessService;
    @RequestMapping("list")
    public ResultEntity list(@RequestBody TbPublicFacility tbPublicFacility){
        Integer id = 1;
        TbBusiness tbBusiness = tbBusinessService.queryObject(id);
        String province = tbBusiness.getProvinceName();
        String city = tbBusiness.getCityName();
        String county = tbBusiness.getCountyName();
        List<TbPremisesInfo> getlist = tbPremisesInfoService.getlist(tbPublicFacility.getName(), province, city, county);
        return ResultEntity.ok(getlist);
    }
}

